/* eslint-disable import/no-anonymous-default-export */
/* eslint-disable jsx-a11y/anchor-is-valid */

import React from "react";
import { Routes, Route } from "react-router";

const PrivateQiuZhiRoute = React.lazy(() => import("../components/PrivateQiuZhiRoute"));
const PrivateZhaoPinRoute = React.lazy(() => import("../components/PrivateZhaoPinRoute"));
const Home = React.lazy(() => import("../pages/Home/Index")); // 首页
const Login = React.lazy(() => import("../pages/Login/Index")); // 登录页
const UserProfile = React.lazy(() => import("../pages/UserProfile/Index")); // 个人中心
const JobList = React.lazy(() => import("../pages/JobList/Index")); // 职位列表
const RecruitManage = React.lazy(() => import("../pages/RecruitManage/Index")); // 招聘管理
const EditResume = React.lazy(() => import("../pages/EditResume/Index")); // 简历编辑
const JobPost = React.lazy(() => import("../pages/JobPost/Index")); //  发布职位

export default () => {
  return (
    <Routes>
      <Route path="/" element={<Home />} />
      <Route path="/login" element={<Login />} />
      {/* PrivateRoute下方都是受保护路由 */}
      <Route element={<PrivateQiuZhiRoute />}>
        <Route path="/profile" element={<UserProfile />} />
      </Route>
      <Route element={<PrivateZhaoPinRoute />}>
        <Route path="/recruitmanage" element={<RecruitManage />} />
      </Route>
      <Route path="/joblist" element={<JobList />} />
      <Route path="/jobpost/:id?" element={<JobPost />} />
      <Route path="/resume/edit/:id?" element={<EditResume />} />
    </Routes>
  );
};
